package com.alias.DAOFactory;


import com.alias.DAO.interfaces.CountryDAO;
import com.alias.DAO.interfaces.CurrencyDAO;
import com.alias.DAO.interfaces.EmployeesDAO;
import com.alias.DAO.interfaces.impl.CountryDAOEmpl;
import com.alias.DAO.interfaces.impl.CurrencyDAOImpl;
import com.alias.DAO.interfaces.impl.EmployeesDAOImpl;

public class DAOFactory {
    private static EmployeesDAO employeesDAO = null;
    private static CountryDAO countryDAO = null;
    private static CurrencyDAO currencyDAO = null;
    private static DAOFactory instance = null;

    public static synchronized DAOFactory getInstance() {
        if (instance == null) {
            instance = new DAOFactory();
        }
        return instance;
    }

    public EmployeesDAO getEmployeesDAO() {
        if (employeesDAO == null) {
            employeesDAO = new EmployeesDAOImpl();
        }
        return employeesDAO;
    }
    public CountryDAO getCountryDAO() {
        if (countryDAO == null) {
            countryDAO = new CountryDAOEmpl();
        }
        return countryDAO;
    }
    public CurrencyDAO getCurrencyDAO() {
        if (currencyDAO == null) {
            currencyDAO = new CurrencyDAOImpl();
        }
        return currencyDAO;
    }


}
